The y position at pos (0..1) along a path, without moving anything.
path_y_at(p, pos) -> real| Name | Type |
|---|---|
p | path |
pos | real |
real
The y position at pos (0..1 along a path's own length) without moving anything - the vertical counterpart to path_x_at.
It is a place in the room, counted from the room's top-left corner (and counting down), like an instance's own y.
A pos is a fraction the game keeps to about one part in four thousand, so it cannot name a corner of a long route to the last hair. It does not need to: give it the pos that is as close to a corner as a pos can get, and you get the corner itself, not a point a little short of it. On a route 400 pixels long whose first corner is 80 pixels along, path_y_at(route, 0.2) is the y of that corner.
var midpoint_y = path_y_at(path_doc_patrol, 0.5);Reads the y position exactly halfway along path_doc_patrol, without moving the walker or anything else.